Lightweight Invariants with Full Dependent Types
نویسندگان
چکیده
Dependent types allow a programmer to express invariant properties of functions, such as the relationship between the input and output lengths of a list. Several “lightweight” approaches to dependent types have been proposed for existing systems, such as Haskell’s Generalised Algebraic Data Types or Type Families. Such approaches are lightweight in the sense that they require minimal modifications to existing systems. However, while these extensions are apparently simple, we find that we often run into limitations fairly quickly. In this paper we will explore these limitations, and show that a full dependent type system allows more straightforward implementation of simple invariants without restricting expressivity.
منابع مشابه
Balancing Lists: A Proof Pearl
Starting with an algorithm to turn lists into full trees which uses non-obvious invariants and partial functions, we progressively encode the invariants in the types of the data, removing most of the burden of a correctness proof. The invariants are encoded using non-uniform inductive types which parallel numerical representations in a style advertised by Okasaki, and a small amount of dependen...
متن کاملIntroducing a Lightweight Structural Model via Simulation of Vernacular “Pa Tu Pa” Arch
The knowledge of Iranian vernacular structures is based on geometry, and there is a possibility of recreating such structural patterns aimed at producing movable structures. The purpose of this research was to utilize the patterns of vernacular structures to provide a lightweight structural model. The questions raised included how to create various forms based on the structural history of any r...
متن کاملCyclic Loading Tests for Cold-Formed Steel Wall Frames with Lightweight Concrete
Lightweight steel framing is a method in housing and construction that have been widely used in lightweight steel construction. In this method, the structure is built by cold formed steel elements. They are cost-effective, light, and easy to assemble. However, the performance of lateral load resisting systems in cold-formed steel structures specially the behavior of cold-formed steel shear wall...
متن کاملDependent Array Type Inference from Tests
We present a type-based program analysis capable of inferring expressive invariants over array programs. Our system combines dependent types with two additional key elements. First, we associate dependent types with effects and precisely track effectful array updates, yielding a sound flow-sensitive dependent type system that can capture invariants associated with side-effecting array programs....
متن کاملDurability of Self-compacting Lightweight Aggregate Concretes (LWSCC) as Repair Overlays
For rehabilitation of damaged concrete structures, the durability of repair overlay is a very important issue. Self-compacting concretes (SCC) are known as a suitable repair overlay materials. In this study, the durability of different self-compacting lightweight aggregate concretes (LWSCC) and effect of lightweight aggregate type on them is investigated. 3 mix designs of LWSCC containing three...
متن کامل